#ifndef _STACK_APP_HEADER_
#define _STACK_APP_HEADER_
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
typedef int ElementType;
typedef struct stack *Stack;
typedef int BOOL;
#define TRUE 1
#define FALSE 0

struct stack;
Stack initStack(int n);
//isEmpty check Stack ptr -> i == -1
#define isEmpty(S) (((S) == NULL) ? TRUE : (S)->i == -1)
#define top(S) (((S) == NULL || (S)->i == -1) ? NULL : (S)->_stack[((S)->i)])
BOOL push(Stack S, ElementType x);
BOOL pop(Stack S, ElementType *x);
void releaseStack(Stack S);
struct stack
{
    int n;
    //栈顶位置
    int i;
    ElementType *_stack;
};
#endif